package com.cyd.springbootweb.controller;

import com.cyd.springbootweb.entity.Person;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;

/**
 * @Description : 描述
 * Created by cyd on 2021-05-10 09:26:19
 */
@Controller
@RequestMapping("/person")
public class PersonController {

    @RequestMapping("/get")
    public String get(Model model) {

        Person single = new Person("aa", 11);

        ArrayList<Person> people = new ArrayList<>();
        people.add(new Person("xx", 11));
        people.add(new Person("yy", 22));
        people.add(new Person("zz", 33));

//        System.out.println(single.getName());

        model.addAttribute("singlePerson", single);
        model.addAttribute("people", people);
        return "testThymeleaf";
    }
}
